﻿using CNI.Repository.Queue;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CNI.Repository.Factory
{
    public class QueueIngestFactory : IIngestRepositoryFactory
    {
        public Repostitory.Interface.IIngestRepository<T> CreateIngestRepository<T>()
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting("StorageConnectionString"));
            var storageQueueName = CloudConfigurationManager.GetSetting("IngestQueueName");
            return new QueueIngestion<T>(storageAccount, storageQueueName);
        }
    }
}
